//
//  setViewController.m
//  TT
//
//  Created by lanou3g on 16/3/10.
//  Copyright © 2016年 Super磊. All rights reserved.
//

#import "setViewController.h"
#import "setViewTableViewCell.h"
#import "SecondTableViewCell.h"
#import "ThirdTableViewCell.h"
#import "FourthTableViewCell.h"

#define Cell @"cell_id"
#define CellTwo @"cell_idTwo"
#define CellThr @"cell_idThr"
#define CellFou @"cell_idFou"
enum {
    
    First,
    Second,
    Third,
    Fourth
}number;
@interface setViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation setViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  
    self.tableView.delegate =self;
    self.tableView.dataSource =self;
    
    //注册cell
    [self.tableView registerNib:[UINib nibWithNibName:@"setViewTableViewCell" bundle:nil] forCellReuseIdentifier:Cell];
    [self.tableView registerNib:[UINib nibWithNibName:@"SecondTableViewCell" bundle:nil] forCellReuseIdentifier:CellTwo];[self.tableView registerNib:[UINib nibWithNibName:@"ThirdTableViewCell" bundle:nil] forCellReuseIdentifier:CellThr];
    [self.tableView registerNib:[UINib nibWithNibName:@"FourthTableViewCell" bundle:nil] forCellReuseIdentifier:CellFou];
}
#pragma mark -Delegate
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 1;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 10;
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    
    UILabel *lable =[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 200, 30)];
    lable.font =[UIFont systemFontOfSize:20];
    lable.textColor =[UIColor grayColor];
    if (section == 0) {
        lable.text =@"向我显示:";
    }else if (section ==1) {
        lable.text =@"搜索范围:";
    }else if (section ==2) {
        lable.text =@"显示年龄:";
    }else if (section ==3) {
        lable.text =@"联系人:";
    }else if (section ==5) {
        lable.text =@"推送通知:";
    }else if (section ==6) {
        lable.text =@"自动播放视频:";
    }else if (section ==7) {
        lable.text =@"朋友圈";
    }else if (section ==8) {
        lable.text =@"账户信息:";
    }else if (section ==9) {
        lable.text =@"缓存:";
    }
    return lable;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    if (indexPath.section ==0) {
        setViewTableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:Cell forIndexPath:indexPath];
        cell.manLable.text =@"男";
        cell.womenLable.text =@"女";
        return cell;
    }else if (indexPath.section ==1 ||indexPath.section ==2) {
        SecondTableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:CellTwo forIndexPath:indexPath];
        return cell;
    }else if (indexPath.section ==3) {
        ThirdTableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:CellThr forIndexPath:indexPath];
        cell.thirdLable.text =@"屏蔽手机联系人";
        return cell;
    }else if (indexPath.section ==4) {
        ThirdTableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:CellThr forIndexPath:indexPath];
        cell.thirdLable.text =@"屏蔽共同联系人";
        return cell;
    }else if (indexPath.section ==5){
        setViewTableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:Cell forIndexPath:indexPath];
        cell.manLable.text =@"显示消息预览";
        cell.womenLable.text =@"振动";
        return cell;
    }else if (indexPath.section ==6) {
        ThirdTableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:CellThr forIndexPath:indexPath];
        cell.thirdLable.text =@"Wi－Fi下自动播放视频";
        return cell;
    }else if (indexPath.section ==7) {
        FourthTableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:CellFou forIndexPath:indexPath];
        cell.fouthLable.text =@"已屏蔽的朋友圈";
        return cell;
    }else if (indexPath.section ==8) {
        FourthTableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:CellFou forIndexPath:indexPath];
        cell.fouthLable.text =@"编辑你的账户信息";
        return cell;
    }else {
    
        FourthTableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:CellFou forIndexPath:indexPath];
        cell.fouthLable.text =@"缓存管理";
        return cell;
    }
    
  
    
    
    


}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 100;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 30;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 40;
}

-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, 30)];
    lable.font =[UIFont systemFontOfSize:12];
    lable.textColor =[UIColor grayColor];
    lable.numberOfLines =0;
    if (section ==2) {
        lable.text =@"在你的选择范围内用户不够多时，我们也会推荐更多的用户给你";
    }else if (section ==3) {
    lable.text =@"屏蔽联系人后，你的好友将不会在探探上看到你";
    }else if (section ==4) {
    lable.text =@"屏蔽共同联系人后，对方将无法看到你和TA的共同联系人，你也无法看到你和对方的共同联系人";
    }
    return lable;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
